<!DOCTYPE html>
<html>
    <head>
    	<!-- 公共头部，必须引用 -->
        <meta charset="utf-8">
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta content="width=device-width, minimum-scale=1,initial-scale=1, maximum-scale=1, user-scalable=1" id="viewport" name="viewport" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<meta content="telephone=no" name="format-detection" />
		<link type="text/css" rel="stylesheet" href="../../template/css/com/com.css"/>
		<link type="text/css" rel="stylesheet" href="../../template/css/list/style.css"/>
        <script type="text/javascript" src="../../script/constants.js"></script>
		<script src="../../template/js/jquery.js"></script>
		<script src="../../template/js/com/com.js"></script>
		<script src="../../template/js/com/template.js"></script>
		<script src="../../resource/my.js"></script>
		<script src="../../script/api.js"></script>
        <link rel="stylesheet" href="../../resource/weuimin.css" />
		<link rel="stylesheet" href="../../resource/example.css" />
        <link rel="stylesheet" href="../../resource/jinsuistyle.css" />
        <script type="text/javascript">
            var data="";
            var str = "";
            apiready=function(){
              if(api.systemType == "ios"){
				   document.getElementById("statusBar").style.background = "#298cb4";
			  }
              $api.fixStatusBar( $api.dom('header') );
              var header = $api.byId('jsheader');
              if(api.systemType=='ios'){
          			$api.fixIos7Bar(header);
          		}

            api.addEventListener({
			    name: 'close'
			}, function(ret, err) {
			    if(ret.value.key==1){
			       api.closeWin();
			    }
			});
               var dm = api.pageParam.dm;
               var mc = api.pageParam.mc;
               show(dm,mc);
               var rel = $api.getStorage('jscg');
               var html = "<ul>";
               for(var i = 0;i<rel.length;i++){
            	   html += "<li><img src=\"http://mobile-1255508964.file.myqcloud.com/app/icon/"+rel[i].ddm+"f.png\" onclick=\"show('"+rel[i].ddm+"','"+rel[i].dmc+"')\" width=\"100%\"/></li>"
               }
               html += "</ul>";
               document.getElementById("left_menu").innerHTML = html;
         }

     	function show(dm,mc){
     	    $("#title").html(mc);
     	    api.ajax({
	            url: url.zcflurl+'?dm='+dm,
	            method: 'get',
	            cache: 'false',
	            timeout: 30,
	            dataTpye: 'json',
	        }, function(ret,err){
	            if (ret) {
                   data = eval("("+ret.json+")");
                   var html ="";
	     		   $("#main_menu").html(html);
	     		   str = ret.json;
	     		   for(var i=0;i<data.length;i++){
     			   html += ("<a class=\"weui-grid \" href=\"javascript:void(0)\" onclick=\"showList('"+ data[i].ddm +"','"+data[i].dmc+"',"+i+")\">"
						+"<img style=\"width:100%;height:100px;\" src=\"http://mobile-1255508964.file.myqcloud.com/app/icon/" + data[i].ddm + ".jpg\" />"
						+"<p class=\"weui-grid-label\"><font>"+ data[i].dmc + "</font></p></a>");
					$("#main_menu").html(html);
     			   }
                }
            });
     	}

        function showList(dm,dmc,i){
        	api.openWin({
			    name: 'list',
			    url: './list.html',
			    pageParam: {
			        qdm: dm,
			        dmc: dmc,
			        i: i,
			        str: str
			    }
			});
        }

        function closeWin(){
         api.closeWin();
        }

        function reMain(){

        }

        function goMain(){
          api.closeWin();
        }
        </script>
        <style type="text/css">
         .com-footer-area {padding-top:0px;position:fixed;bottom:0;}
        .com-footer-area  img{height:auto;width:100%;} 
        	.weui-grid{width:50%;padding:2%;}
        	.weui-grid-main{text-align: center;}
        	.weui-grid__icon{width:70px;height:70px;}
        	.weui-grid-main1{
	        	height: 100px;
	        	line-height:100px;
	        	text-align: center;
	        	font-size:16px;
	        	font-weight:bold;
	        	color:#f7f6f6;
	        	background: #FFFFFF url('../../resource/images/main_bg.png') no-repeat 36px 0px ;
        	}
        	.weui-grid-label{
	        	/* height: 100px;
	        	font-size:16px;
	        	font-weight:bold;
	        	color:#FFFFA9;
	        	text-align: center;
	        	text-shadow: #171616 0 1px 0;
	        	background: #FFFFFF url('../../resource/images/menu_bg.png') no-repeat 50% 0px ; */
	        }
	        .weui-grid {display: table;}
	        .weui-grid-label{width: 100px;margin: 0 auto;text-align: center;}
		   /*  .weui-grid-label font {
		    			    width: 100px;
		    			    line-height:22px;
		    			    padding: 0 10px;
		    			    height: 100px;
		    			    word-break: break-all;
		    			    text-align: center;
		    			    vertical-align: middle;
		    			    margin: 0 auto;
		    			    word-wrap: break-word;
		    			    display: table-cell;
		    			} */
        	.isnew{background: #FFFFFF url('../../template/images/xp4.png') no-repeat 100% 0px ;}
        	.weui-grid:after,.weui-grid:before{border-width:0px;}
        </style>
    </head>
    <body>
     <header id="statusBar">
      <div id="jsheader">
          <nav id="jsnav">
              <a id="jsleft" tapmode="" onclick="api.closeToWin({name: 'root'});">
                  <span>主页</span>
              </a>
              <div id="jsmiddle">
                  <strong id="jstitle">金穗采购</strong>
              </div>
              <a id="jsright">
                <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
              </a>
          </nav>
      </div>
      </header>

	<div class="com-content" style="padding-bottom:0px;margin-bottom: 0px;">
		<!-- <div class="com-header-area" id="js-com-header-area">
			<a href="" class="com-header-logo"
				style="width:100%;color:#FFFFFF;text-align:center;font-size:24px;">金穗采购</a>
			<dfn></dfn>
			<div class="clear"></div>
		</div> -->
		    <div class="com-header-area" id="js-com-header-area" style="padding-bottom:0px;margin-bottom: 0px;">
			<!-- <a href="" class="com-header-logo"
				style="width:100%;color:#FFFFFF;text-align:center;font-size:20px;">金穗采购</a> -->
				<img src="../../image/jscg0.png" style="width:100%;"/>
				<ul class="menu_ul">
					<a href="jscg.html" class="selected"><li>首  页</li></a>
					<a href="history.html"><li>历 史 订 单</li></a>
					<a href="bill.html"><li>购 物 框</li></a>
				</ul>
			<dfn></dfn>
			<div class="clear"></div>
		</div>  
		
		
		
			<!--content-->
			<div class="page-role style-page">
				<!-- <div class="pxui-tab pxui-tab-nav pxui-tab-no-top">
					<a href="jscg.html"   class="selected"><i></i>首 页<span></span></a>
					<a href="history.html"><i></i>历史订单<span></span></a>
					<a href="bill.html"><i></i>购物筐<span></span></a>
				</div>-->
				<div class="page-title">
					<a href="#" onclick="closeWin();" class="return">返 回</a>
					<b id="title"></b>
				</div>
				<div style="min-height:300px;">
							<div style="background-color:#fff;">
								<div style="width:29%;float:left;" id="left_menu">
								</div>
								<div class="weui-grids" style="width:70%;float:right;" id="main_menu">
									<div style="background-color:#fff;">
								<div class="weui-grids" id="main_menu">

								</div>
							</div>
								</div>
							</div>
				</div>
			</div> 
		</div>
		
	</div>
	
	<!-- 加载动画 -->
	<div id="loadingToast" style="display:none;">
			<div class="weui-mask_transparent"></div>
			<div class="weui-toast">
				<i class="weui-loading weui-icon_toast"></i>
				<p class="weui-toast__content">数据加载中...</p>
			</div>
		</div>
		
	<!-- 公共底部，必须引用 -->
		<div style="height: 50px"></div>
			<div class="com-footer-area footer" id="js-com-footer" style="width:100%;height:60px">
				<img src="../../image/db.png" style="width:100%;height:100%">
			</div>
		
</body>
</html>
